package com.yunchao.test.presentation.screen

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter4.BaseQuickAdapter
import com.yunchao.test.databinding.LayoutLockLogItemBinding

internal class MainAdapter : BaseQuickAdapter<String, MainAdapter.VH>(){
    override fun onBindViewHolder(
        holder: VH,
        position: Int,
        item: String?
    ) {
        holder.binding.lockLogItem.text = item
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): VH = VH(parent)

    inner class VH(
        parent: ViewGroup,
        val binding: LayoutLockLogItemBinding = LayoutLockLogItemBinding.inflate(
            LayoutInflater.from(parent.context),
            parent,
            false
        )
    ) : RecyclerView.ViewHolder(binding.root)
}